package com.hdax.dm.mapstucts;

import com.hdax.dm.beans.item.Item;
import com.hdax.dm.beans.item.ItemType;
import com.hdax.dm.dto.floorDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "Spring")
public abstract class floorDtoMapper {

    @Mappings({
            @Mapping(source = "id", target = "index"),
            @Mapping(source = "itemType", target = "itemTypeName"),
            @Mapping(source = "id", target = "itemTypeId")
    })
    public abstract floorDto toTarget(ItemType source);

    @Mappings({
            @Mapping(source = "startTime", target = "startDate"),
            @Mapping(source = "endTime", target = "endDate"),
            @Mapping(source = "minPrice", target = "minPrice")
    })
    public abstract floorDto.items toItem(Item source);

    public abstract List<floorDto> toTargetList(List<ItemType> sources);


    public abstract List<floorDto.items> toItemList(List<Item> sources);
}
